<template>
  <view class="tabbar">
    <view :class="activeColor(0)" @tap="$emit('update:selectIndex', 0)">
      任务
    </view>
    <view :class="activeColor(1)" @tap="$emit('update:selectIndex', 1)">
      管理
    </view>
  </view>
</template>

<script>
export default {
  name: "Tabbar",
  props: {
    selectIndex: {
      type: Number,
      default: 0
    }
  },
  methods: {
    activeColor(index) {
      if (this.selectIndex === index) {
        return "active-color"
      }
    }
  }
}
</script>

<style lang="scss" scoped src="./index.scss"></style>
